import { myaxios } from "../myaxios";

export const circle = {
  /**
   * 查询所有帖子
   * @param {*} params{pno:1,pagesize:3}
   * @returns 
   */
  queryALL(params) {
    let url = '/circle/blogs'
    return myaxios.get(url, params)
  },
  /**
   * 查询所有赞
   * @param {} params{bid:1} 
   * @returns 
   */
  queryAllHelp(params) {
    let url = '/circle/pet_blogs_d'
    return myaxios.get(url, params)
  },

  /**
   * 通过id查询帖子
   * @param {*} params {b_id:1}
   * @returns 
   */
  queryById(params) {
    let url = '/circle/blogs_id'
    return myaxios.get(url, params)
  },

  /**
   * 通过id查询评论
   * @param {*} params 
   * @returns 
   */
  queryAllComment(params) {
    let url = '/circle/blogs_comment'
    return myaxios.get(url, params)
  },
  /**
   * 添加评论
   * @param {*} params{u_id:1,b_id:1,c_comment:可爱} 
   * @returns 
   */
  addComment(params) {
    let url = '/circle/blogs_comment_add'
    return myaxios.post(url, params)
  },
  /**
   * 删除评论
   * @param {*} params 
   * @returns 
   */
  delComment(params) {
    let url = '/circle/blogs_comment_del'
    return myaxios.delete(url, params)
  },
  /**
   * 点赞
   * @param {d} params 
   * @returns 
   */
  addHelp(params) {
    let url = '/circle/pet_blogs_d_add'
    return myaxios.post(url, params)
  },
  /**
   * 取消点赞
   * @param {d} params 
   * @returns 
   */
  delHelp(params) {
    let url = '/circle/pet_blogs_d_del'
    return myaxios.delete(url, params)
  },
  /**
   * 添加帖子
   * @param {*} params 
   * @returns 
   */
  addtiezi(params) {
    let url = '/circle/blogs_add'
    return myaxios.post(url, params)
  },
  /**
   * 删除评论
   * @param {*} params 
   * @returns 
   */
  delComments(params){
    let url='/circle/blogs_del'
    return myaxios.delete(url,params)
  }

}
